<!DOCTYPE html><html class=split lang=en-US-x-hixie><script src=../link-fixup.js defer=""></script>
<!-- Mirrored from html.spec.whatwg.org/dev/structured-data.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 10 Sep 2025 08:36:24 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<meta charset=utf-8><meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name=viewport><title>HTML Standard, Edition for Web Developers</title><meta content=#3c790a name=theme-color><meta content="light dark" name=color-scheme><link rel=stylesheet href=../../resources.whatwg.org/standard-shared-with-dev.css crossorigin=""><link rel=icon href=https://resources.whatwg.org/logo.svg crossorigin=""><link rel=stylesheet href=styles.css crossorigin=""><script>
   function toggleStatus(div) {
     div.parentNode.classList.toggle('wrapped');
   }
   function setLinkFragment(link) {
     link.hash = location.hash;
   }
  </script><body>
  <script async="" src=search.js></script>
  
  
  <header id=head class="head with-buttons">
   <a href=https://whatwg.org/ class=logo><img width=100 alt=WHATWG crossorigin="" class=darkmode-aware src=https://resources.whatwg.org/logo.svg height=100></a>
   
   <hgroup><h1><a rel=home href=index.html>HTML: The Living Standard</a></h1><p id=dev-edition-h2>Edition for Web Developers — Last Updated <span class=pubdate>10 September 2025</span></hgroup>
   

   <div id=search>
    <input placeholder="Search. Press '/'" autocomplete=off name=query id=query type=search>
    <ol id=results></ol>
   </div>
  </header>

  

  

  

  
  

  
  

  

  <nav><a href=common-dom-interfaces.html>← 2.5 Common DOM interfaces</a> — <a href=index.html>Table of Contents</a> — <a href=dom.html>3 Semantics, structure, and APIs of HTML documents →</a></nav><ol class=toc><li><ol><li><a href=structured-data.html#safe-passing-of-structured-data><span class=secno>2.6</span> Safe passing of structured data</a><ol><li><a href=structured-data.html#serializable-objects><span class=secno>2.6.1</span> Serializable objects</a><li><a href=structured-data.html#transferable-objects><span class=secno>2.6.2</span> Transferable objects</a><li><a href=structured-data.html#structured-cloning><span class=secno>2.6.3</span> Structured cloning API</a></ol></ol></ol><h3 id=safe-passing-of-structured-data><span class=secno>2.6</span> Safe passing of structured data<a href=#safe-passing-of-structured-data class=self-link></a></h3>

  <p id=structuredclone><span id=structured-clone></span>To support passing JavaScript objects,
  including <a href=https://webidl.spec.whatwg.org/#dfn-platform-object id=safe-passing-of-structured-data:platform-object data-x-internal=platform-object>platform objects</a>, across <a id=safe-passing-of-structured-data:realm href=https://tc39.es/ecma262/#sec-code-realms data-x-internal=realm>realm</a>
  boundaries, this specification defines infrastructure for
  serializing and deserializing objects, including in some cases transferring the underlying data
  instead of copying it. Collectively this serialization/deserialization process is known as
  "structured cloning", although most APIs perform separate serialization and deserialization steps.
  (With the notable exception being the <code id=safe-passing-of-structured-data:dom-structuredclone><a href=#dom-structuredclone>structuredClone()</a></code>
  method.)</p>

  

  <h4 id=serializable-objects data-lt="serializable object" data-export=""><span class=secno>2.6.1</span> <dfn>Serializable objects</dfn><a href=#serializable-objects class=self-link></a></h4><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/https://developer.mozilla.org/en-US/docs/Glossary/Serializable_object title="Serializable objects are objects that can be serialized and later deserialized in any JavaScript environment (&quot;realm&quot;). This allows them to, for example, be stored on disk and later restored, or cloned with structuredClone(), or shared between workers using DedicatedWorkerGlobalScope.postMessage().">/developer.mozilla.org/en-US/docs/Glossary/Serializable_object</a><div class=support><span class="firefox yes"><span>Firefox</span><span>103+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>77+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div>

  <p><a href=#serializable-objects id=serializable-objects:serializable-objects>Serializable objects</a> support being serialized, and later deserialized, in a way
  that is independent of any given <a id=serializable-objects:realm href=https://tc39.es/ecma262/#sec-code-realms data-x-internal=realm>realm</a>. This allows them to be stored on disk and
  later restored, or cloned across <a id=serializable-objects:agent href=https://tc39.es/ecma262/#sec-agents data-x-internal=agent>agent</a> and even <a id=serializable-objects:agent-cluster href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent cluster</a>
  boundaries.</p>

  <p>Not all objects are <a href=#serializable-objects id=serializable-objects:serializable-objects-2>serializable objects</a>, and not all aspects of objects that are
  <a href=#serializable-objects id=serializable-objects:serializable-objects-3>serializable objects</a> are necessarily preserved when they are serialized.</p>

  

  <h4 id=transferable-objects data-lt="transferable object" data-export=""><span class=secno>2.6.2</span> <dfn>Transferable objects</dfn><a href=#transferable-objects class=self-link></a></h4>

  <p><a href=#transferable-objects id=transferable-objects:transferable-objects>Transferable objects</a> support being transferred across <a href=https://tc39.es/ecma262/#sec-agents id=transferable-objects:agent data-x-internal=agent>agents</a>. Transferring is effectively recreating the object while sharing a
  reference to the underlying data and then detaching the object being transferred. This is useful
  to transfer ownership of expensive resources. Not all objects are <a href=#transferable-objects id=transferable-objects:transferable-objects-2>transferable
  objects</a> and not all aspects of objects that are <a href=#transferable-objects id=transferable-objects:transferable-objects-3>transferable objects</a> are
  necessarily preserved when transferred.</p>

  <p class=note>Transferring is an irreversible and non-idempotent operation. Once an object has
  been transferred, it cannot be transferred, or indeed used, again.</p>

  

  <h4 id=structured-cloning><span class=secno>2.6.3</span> Structured cloning API<a href=#structured-cloning class=self-link></a></h4>

  <dl class=domintro><dt><code><var>result</var> = self.<span id=dom-structuredclone>structuredClone</span>(<var>value</var>[, { <span>transfer</span> }])</code><div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/structuredClone title="The global structuredClone() method creates a deep clone of a given value using the structured clone algorithm.">structuredClone</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>94+</span></span><span class="safari yes"><span>Safari</span><span>15.4+</span></span><span class="chrome yes"><span>Chrome</span><span>98+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>98+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><dd>
    <p>Takes the input value and returns a deep copy by performing the structured clone algorithm.
    <a href=#transferable-objects id=structured-cloning:transferable-objects>Transferable objects</a> listed in the <code>transfer</code> array are transferred, not
    just cloned, meaning that they are no longer usable in the input value.</p>

    <p>Throws a <a id=structured-cloning:datacloneerror href=https://webidl.spec.whatwg.org/#datacloneerror data-x-internal=datacloneerror>"<code>DataCloneError</code>"</a> <code id=structured-cloning:domexception><a data-x-internal=domexception href=https://webidl.spec.whatwg.org/#dfn-DOMException>DOMException</a></code> if any part of
    the input value is not <a href=#serializable-objects id=structured-cloning:serializable-objects>serializable</a>.</p>
   </dl>

  


  <nav><a href=common-dom-interfaces.html>← 2.5 Common DOM interfaces</a> — <a href=index.html>Table of Contents</a> — <a href=dom.html>3 Semantics, structure, and APIs of HTML documents →</a></nav>
